<?php
/**
 * Module Template - categories_tabs
 *
 * Template stub used to display categories-tabs output
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_modules_categories_tabs.php 3395 2006-04-08 21:13:00Z ajeh $
 */

  include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_CATEGORIES_TABS));
?>
<div>
<?php
function DLRtree($data,$parent,$deep=0,$prePath=''){
	if (count($data[$parent])>0){
		$prePath = $prePath==''?'':$prePath.'_';
		echo '<ul class="nav_ul'.$deep.'" >';
		if ($deep==0){
			echo '<li class="nav_li0"><a class="nav_a'.$deep.'" href="'.HTTP_SERVER.DIR_WS_CATALOG.'">Home</a></li>';
			echo '<li class="nav_li0 nav_separator">&nbsp;</li>';
		}	
		foreach ($data[$parent] as $sub_array){
			echo '<li class="nav_li'.$deep.'" style="padding-left:'.$deep.'px;">';
			echo '<a class="nav_a'.$deep.'" href="'.zen_href_link(FILENAME_DEFAULT, 'cPath=' . $prePath.(int)$sub_array['categories_id']).'">';
			if ($deep!=0)
				echo '<span class="nav_decoration-left"></span>';
			echo $sub_array['categories_name'];
			if ($deep!=0)
				echo '<span class="nav_decoration-right"></span>';
			echo '</a>';
//			if ($deep==0) echo '<span></span>';
			if (count($data[$sub_array['categories_id']])>0){
//				if ($deep==0)
//					echo '<div class="nav_hack">';
				DLRtree($data,$sub_array['categories_id'],$deep+1,$prePath.$sub_array['categories_id']);
//				if ($deep==0){
//					echo '</div>';
//				}	
			}			
			echo '</li>';
			if ($deep==0)
				echo '<li class="nav_li0 nav_separator">&nbsp;</li>';
		}
//			if ($deep==0){
//				echo '<li class="nav_li'.$deep.'" style="padding-left:'.$deep.'px;"><a class="nav_a'.$deep.'" href="'.zen_href_link(FILENAME_CONTACT_US).'" rel="nofollow">Contact Us</a><span></span></li>';
//				echo '<li class="nav_li'.$deep.'" style="padding-left:'.$deep.'px;"><a class="nav_a0">FAQ</a><div class="nav_hack" style="width:80px;"><ul class="nav_ul1">';
//				echo '<li class="nav_li1" style="padding-left:1px;"><a href="' . zen_href_link(FILENAME_SHIPPING) . '" rel="nofollow">' . BOX_INFORMATION_SHIPPING . '</a></li>';
//				echo '<li class="nav_li1" style="padding-left:1px;"><a href="' . zen_href_link(FILENAME_PRIVACY) . '" rel="nofollow">' . BOX_INFORMATION_PRIVACY . '</a></li>';
//				echo '<li class="nav_li1" style="padding-left:1px;"><a href="' . zen_href_link(FILENAME_CONDITIONS) . '" rel="nofollow">' . BOX_INFORMATION_CONDITIONS . '</a></li>';
//				echo '<li class="nav_li1" style="padding-left:1px;"><a href="' . zen_href_link(FILENAME_GV_FAQ) . '" rel="nofollow">' . BOX_INFORMATION_GV . '</a></li>';
//				echo '</ul></div></li>';
//			}
		echo '</ul>';
	}
}
DLRtree($c_array,0);
?>
</div>
<?php 
?>